<extend name="Layout/ins_page" />
<block name="content">
	<eq name="vo.doc_type" value="1">
		{:W('PageHeader/simple',array('name'=>"收入详细内容"))}
	</eq>
	<eq name="vo.doc_type" value="2">
		{:W('PageHeader/simple',array('name'=>"支出详细内容"))}
	</eq>
	<eq name="vo.doc_type" value="3">
		{:W('PageHeader/simple',array('name'=>"转账详细内容"))}
	</eq>
	<div class="operate panel panel-default">
		<div class="panel-body">
			<div class="pull-left">
				<a onclick="go_return_url();" class="btn btn-sm btn-primary">返回</a>
				<if condition="$auth['admin']">
					<a onclick="del();" class="btn btn-sm btn-danger">删除</a>
				</if>
			</div>
			<div class="pull-right">
				<a onclick="winprint()" class="btn btn-sm btn-primary hidden-xs">打印</a>
				<if condition="$auth['write']">
					<a onclick="edit();" class="btn btn-sm btn-primary">修改</a>
				</if>
			</div>
		</div>
	</div>
	<eq name="vo.doc_type" value="1">
		<form method='post' id="form_data" name="form_data" enctype="multipart/form-data"   class="well form-horizontal">
			<div class="form-group col-sm-6">
				<label class="col-sm-4 control-label" for="doc_no">单据编号：</label>
				<div class="col-sm-8">
					<p class="form-control-static">
						{$vo.doc_no}
					</p>
				</div>
			</div>
			<div class="form-group col-sm-6">
				<label class="col-sm-4 control-label" for="end_date" >日期：</label>
				<div class="col-sm-8">
					<p class="form-control-static">
						{$vo.input_date}
					</p>
				</div>
			</div>
			<div class="form-group col-sm-6">
				<label class="col-sm-4 control-label" for="account_id">客户名称：</label>
				<div class="col-sm-8">
					<p class="form-control-static">
						{$vo.partner}
					</p>
				</div>
			</div>
			<div class="form-group col-sm-6">
				<label class="col-sm-4 control-label" >收入项目：</label>
				<div class="col-sm-8">
					<p class="form-control-static">
						{$vo.type}
					</p>
				</div>
			</div>
			<div class="form-group col-sm-6">
				<label class="col-sm-4 control-label" for="account_id">交易帐号：</label>
				<div class="col-sm-8">
					<p class="form-control-static">
						{$vo.account_name}
					</p>
				</div>
			</div>
			<div class="form-group col-sm-6">
				<label class="col-sm-4 control-label" >账户余额：</label>
				<div class="col-sm-8">
					<input class="form-control" id="balance" type="text" readonly="readonly" >
				</div>
			</div>

			<div class="form-group col-sm-6">
				<label class="col-sm-4 control-label" for="payment">金额：</label>
				<div class="col-sm-8">
					<p class="form-control-static">
						{$vo.income}
					</p>
				</div>
			</div>
			<div class="form-group col-sm-6">
				<label class="col-sm-4 control-label" for="actor_user_name">经办人：</label>
				<div class="col-sm-8">
					<p class="form-control-static">
						{$vo.actor_name}
					</p>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label" for="remark">摘要：</label>
				<div class="col-sm-10">
					<p class="form-control-static">
						{$vo.remark}
					</p>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label" for="name">附件：</label>
				<div class="col-sm-10">
					{:W('FileUpload/view',array('mode'=>'add'))}
				</div>
			</div>
		</form>
	</eq>
	<eq name="vo.doc_type" value="2">
		<form method='post' id="form_data" name="form_data" enctype="multipart/form-data"   class="well form-horizontal">
			<div class="form-group col-sm-6">
				<label class="col-sm-4 control-label" for="doc_no">单据编号：</label>
				<div class="col-sm-8">
					<p class="form-control-static">
						{$vo.doc_no}
					</p>
				</div>
			</div>
			<div class="form-group col-sm-6">
				<label class="col-sm-4 control-label" for="end_date" >日期：</label>
				<div class="col-sm-8">
					<p class="form-control-static">
						{$vo.input_date}
					</p>
				</div>
			</div>
			<div class="form-group col-sm-6">
				<label class="col-sm-4 control-label" for="account_id">供应商名称：</label>
				<div class="col-sm-8">
					<p class="form-control-static">
						{$vo.partner}
					</p>
				</div>
			</div>
			<div class="form-group col-sm-6">
				<label class="col-sm-4 control-label" >支出项目：</label>
				<div class="col-sm-8">
					<p class="form-control-static">
						{$vo.type}
					</p>
				</div>
			</div>
			<div class="form-group col-sm-6">
				<label class="col-sm-4 control-label" for="account_id">交易帐号：</label>
				<div class="col-sm-8">
					<p class="form-control-static">
						{$vo.account_name}
					</p>
				</div>
			</div>
			<div class="form-group col-sm-6">
				<label class="col-sm-4 control-label" >账户余额：</label>
				<div class="col-sm-8">
					<input class="form-control" id="balance" type="text" readonly="readonly" >
				</div>
			</div>

			<div class="form-group col-sm-6">
				<label class="col-sm-4 control-label" for="payment">金额：</label>
				<div class="col-sm-8">
					<p class="form-control-static">
						{$vo.payment}
					</p>
				</div>
			</div>
			<div class="form-group col-sm-6">
				<label class="col-sm-4 control-label" for="actor_user_name">经办人：</label>
				<div class="col-sm-8">
					<p class="form-control-static">
						{$vo.actor_user_name}
					</p>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label" for="remark">摘要：</label>
				<div class="col-sm-10">
					<p class="form-control-static">
						{$vo.remark}
					</p>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label" for="name">附件：</label>
				<div class="col-sm-10">
					{:W('FileUpload/view',array('mode'=>'add'))}
				</div>
			</div>
		</form>
	</eq>
	<eq name="vo.doc_type" value="3">
		<form method='post' id="form_data" name="form_data" enctype="multipart/form-data"   class="well form-horizontal">
			<div class="form-group col-sm-6">
				<label class="col-sm-4 control-label" for="doc_no">单据编号：</label>
				<div class="col-sm-8">
					<p class="form-control-static">
						{$vo.doc_no}
					</p>
				</div>
			</div>
			<div class="form-group col-sm-6">
				<label class="col-sm-4 control-label" for="end_date" >日期：</label>
				<div class="col-sm-8">
					<p class="form-control-static">
						{$vo.input_date}
					</p>
				</div>
			</div>
			<div class="form-group col-sm-6">
				<label class="col-sm-4 control-label" for="account_id_payment">转出帐号：</label>
				<div class="col-sm-8">
					<p class="form-control-static">
						<empty name="vo.income">
							{$vo.related_account_name}
							<else/>
							{$vo.account_name}
						</empty>
					</p>
				</div>
			</div>
			<div class="form-group col-sm-6">
				<label class="col-sm-4 control-label" for="account_id_income">转入帐号：</label>
				<div class="col-sm-8">
					<p class="form-control-static">
						<empty name="vo.income">
							{$vo.account_name}
							<else/>
							{$vo.related_account_name}
						</empty>
					</p>
				</div>
			</div>
			<div class="form-group col-sm-6">
				<label class="col-sm-4 control-label" for="money">金额：</label>
				<div class="col-sm-8">
					<p class="form-control-static">
						<empty name="vo.income">
							{$vo.payment}
							<else/>
							{$vo.income}
						</empty>
					</p>
				</div>
			</div>
			<div class="form-group col-sm-6">
				<label class="col-sm-4 control-label" for="actor_user_name">经办人：</label>
				<div class="col-sm-8">
					<p class="form-control-static">
						{$vo.actor_name}
					</p>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label" for="name">附件：</label>
				<div class="col-sm-10">
					{:W('FileUpload/view',array('mode'=>$vo['add_file']))}
				</div>
			</div>
		</form>
	</eq>
</block>
<block name="js">
	<script type="text/javascript">
		$(document).ready(function() {
			set_return_url(document.location, 1);
			$.getJSON("{:U('Finance/read_account')}", {
				account_id : {$vo.account_id}
			}, function(data) {
				if (data.status == 1) {
					$("#balance").val(data.data.balance);
				}
			});
		});
	</script>
</block>